﻿#region copyright info
//------------------------------------------------------------------------------
// <copyright company="the9.com">
//     Copyright (c) 1999-2010 第九城市.  All rights reserved.
//     Contact:		MSN:zhouyu@cszi.com , QQ:478779122
//		Link:				http://www.the9.com
// </copyright>
//------------------------------------------------------------------------------
#endregion

using System.Configuration;

namespace CS.WinServiceManager
{
    /// <summary>
    ///   TaskWindowsService通用服务配置
    /// </summary>
    /// 
    /// <description class = "Task.WinService.ConfigUtility">
    ///   
    /// </description>
    /// 
    /// <history>
    ///   2010-3-12 14:10:15 , zhouyu ,  创建	     
    ///  </history>
    internal class ServiceInfo
    {

        public ServiceInfo(string exeFile)
        {
            var config = ConfigurationManager.OpenExeConfiguration(exeFile);
            ServiceName = config.AppSettings.Settings["service_Name"].Value.Trim();
            DisplayName = config.AppSettings.Settings["service_DisplayName"].Value.Trim();
            Description = config.AppSettings.Settings["service_Description"].Value.Trim();
        }

        /// <summary>
        /// 服务名称
        /// </summary>
        public string ServiceName { get; private set; }

        /// <summary>
        /// 服务显示名称
        /// </summary>
        public string DisplayName { get; private set; }

        /// <summary>
        /// 服务描述
        /// </summary>
        public string Description { get; private set; }
    }
}